﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using MyWeb.Data;
using MyWeb.Business;
using MyWeb.Common;

namespace MobileRecharge
{
    public partial class CreateNewAccount : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            
        }

        protected void btnInsert_Click(object sender, EventArgs e)
        {
            try
            {
                tb_UserInfo obj = new tb_UserInfo();
                obj.Username = txtUsername.Text;
                obj.Password = txtPassword.Text;
                obj.Address = txtAddress.Text;
                obj.Phone = txtPhone.Text;
                String sex = "True";
                if (ddlSex.SelectedValue.ToString() != "Male")
                {
                    sex = "False";
                }
                obj.Gender = sex;
                obj.Status = "True";
                tb_UserService.tb_User_Insert(obj);
                Session["Username"] = txtUsername.Text;
                Session["Password"] = txtPassword.Text;
                WebMsgBox.Show("Register Successful");
                Response.Redirect("Recharge.aspx");
            }
            catch (Exception)
            {
                
                throw;
            }
            
        }
    }
}